network object

This method destroys a host.

bool destroy()

Parameters:
None.

Return value:
true on success, false on failure.

Remarks:
This method will return the host to its initial uninitialized state, and destroy all its peers. Before it is destroyed, the host calls disconnect_peer_forcefully on all the connected peers, in order to inform them of its action in the majority of cases so that they do not simply time out. Since this does not guarantee that the remote peers are notified, it may not be sufficient and you will want to disconnect every peer manually before destroying the host if you are concerned about the possibility of some of the remote peers having to time out.

Example:
See the main network chapter.